package cn.zerlynn.sql.dialect.model;

import java.util.List;
import java.util.Optional;

/**
 * Table
 *
 * @author: zerlynn
 * @createTime: 2024/10/24 0:14
 */
public class Table {
    private String schema;
    private String name;
    private String comment;
    private List<Column> columns;
    private List<Constraint> constraints;

    public Table(String name, String schema, List<Column> columns, List<Constraint> constraints) {
        this.name = name;
        this.schema = schema;
        this.columns = columns;
        this.constraints = constraints;
    }

    public String getName() {
        return name;
    }

    public Optional<String> getSchema() {
        return Optional.ofNullable(schema);
    }

    public List<Column> getColumns() {
        return columns;
    }

    public List<Constraint> getConstraints() {
        return constraints;
    }
}
